package router

import (
	"fmt"
	"wf-deploy-agent/conf"
	"wf-deploy-agent/infra"
)

func Start() {
	router := build()
	attachHandlers(router)
	go func() {
		err := router.Run(fmt.Sprintf(":%d", conf.CF.Agent.Service.Port))
		if err != nil {
			infra.Logger.Panicf("HttpServerRun:%d err:%v", conf.CF.Agent.Service.Port, err)
		}
	}()
}
